package com.yangwudongxi.sqlloghelper.dto;

import lombok.Builder;
import lombok.Data;

import java.util.List;

/**
 * ER图生成结果
 *
 * @author 氧屋东西
 */
@Data
@Builder
public class ErDiagramResult {
    
    private List<TableInfo> tables;
    private List<Relationship> relationships;
    private String aiAnalysis;
    
    @Data
    @Builder
    public static class TableInfo {
        private String name;
        private String comment;
        private List<FieldInfo> fields;
    }
    
    @Data
    @Builder
    public static class FieldInfo {
        private String name;
        private String type;
        private String comment;
        private Boolean isPrimaryKey;
        private Boolean isForeignKey;
    }
    
    @Data
    @Builder
    public static class Relationship {
        private String fromTable;
        private String toTable;
        private String type; // one-to-one, one-to-many, many-to-many
        private String label;
        private String fromField;
        private String toField;
    }
}